package router;

public class TurfMainRouterProxy implements router.TurfMainRouter {
  private String _endpoint = null;
  private router.TurfMainRouter turfMainRouter = null;
  
  public TurfMainRouterProxy() {
    _initTurfMainRouterProxy();
  }
  
  public TurfMainRouterProxy(String endpoint) {
    _endpoint = endpoint;
    _initTurfMainRouterProxy();
  }
  
  private void _initTurfMainRouterProxy() {
    try {
      turfMainRouter = (new router.TurfMainRouterServiceLocator()).getTurfMainRouter();
      if (turfMainRouter != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)turfMainRouter)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)turfMainRouter)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (turfMainRouter != null)
      ((javax.xml.rpc.Stub)turfMainRouter)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public router.TurfMainRouter getTurfMainRouter() {
    if (turfMainRouter == null)
      _initTurfMainRouterProxy();
    return turfMainRouter;
  }
  
  public java.lang.String route(java.lang.String[] abc) throws java.rmi.RemoteException{
    if (turfMainRouter == null)
      _initTurfMainRouterProxy();
    return turfMainRouter.route(abc);
  }
  
  
}